#pragma once

#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sendfile.h>


#include <iostream>
#include <vector>
#include <string>
#include <numeric>

#include "ByteBuffer.hh"
#include "HttpProtocol.hh"
//#include "tcpImpl.h"


class TcpClient{
	
	protected:
		int fd;// assign fd
	public:
		TcpClient(int fd);
		virtual size_t onRead()=0;
		virtual size_t onWrite()=0;
};

class TcpClientImpl:public TcpClient{
	private:
	  void *   request_data;
	  size_t  request_size=0;
	  std::string responseHead;

	  //httpimpl imp;
	  HttpResponse res;
	  
	public:
		TcpClientImpl(int fd):TcpClient(fd){};
		size_t onRead();
		size_t onWrite();
	

};
